package com.ss.android.account.http;

import com.bytedance.retrofit2.Retrofit;
import com.bytedance.ttnet.utils.RetrofitUtils;

import java.util.HashMap;
import java.util.Map;

public final class a {
    private static Map<String, Retrofit> a = new HashMap();

    private static Retrofit a(String arg3) {
        Retrofit v0 = null;
        Class v1 = a.class;
        synchronized (v1) {
            if (!android.support.design.a.isTextEmpty(arg3)) {
                Object v0_2 = a.get(arg3);
                if (v0_2 == null) {
                    v0 = RetrofitUtils.createRetrofit(arg3, null, null);
                    a.put(arg3, v0);
                }
            }
        }
        return v0;
    }

    public static synchronized <S> S a(String str, Class<S> cls) {
        S a2;
        synchronized (a.class) {
            a2 = RetrofitUtils.createService(a(str), cls);
        }
        return a2;
    }

}

